package com.ldk.framework.dao.impl;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import com.ldk.base.framework.dao.impl.BaseDAO;
import com.ldk.framework.dao.IAreaDAO;
import com.ldk.framework.entity.Area;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* AreaDAO接口实现类
* @author mqy
*/
@Repository
public class AreaDAO extends BaseDAO<Area> implements IAreaDAO {
    @Override
    public List<Area> getChildAreaList(String dbKey, long parentId) {
        try{
            Map<String, Object> parms = new HashMap<String, Object>();
            parms.put("parentId", parentId);
            SqlSession sqlSession = getSqlSession(dbKey);
            return sqlSession.selectList(getSqlName("selectList"), parms);
        }
        catch(Exception e){
            logger.error(e.getMessage());
        }
        return null;
    }
}
